﻿using SD.Infrastructure.DTOBase;
using SlamDunk.MES.IAppService.DTOs.Outputs.FoundationContext;
using SlamDunk.MES.IAppService.DTOs.Outputs.PlanContext;
using SlamDunk.MES.IAppService.DTOs.Outputs.ResourceContext;
using SlamDunk.ValueObjects.Enums;
using SlamDunk.ValueObjects.Structs;
using System;
using System.Runtime.Serialization;

namespace SlamDunk.MES.IAppService.DTOs.Outputs.ExecutionContext
{
    /// <summary>
    /// 工单数据传输对象
    /// </summary>
    [DataContract]
    public class WorkOrderInfo : BaseDTO
    {
        #region 生产计划Id —— Guid? ProductionPlanId
        /// <summary>
        /// 生产计划Id
        /// </summary>
        [DataMember]
        public Guid? ProductionPlanId { get; set; }
        #endregion

        #region 作业计划Id —— Guid ExecutionPlanId
        /// <summary>
        /// 作业计划Id
        /// </summary>
        [DataMember]
        public Guid ExecutionPlanId { get; set; }
        #endregion

        #region 工艺段Id —— Guid ProcessSegmentId
        /// <summary>
        /// 工艺段Id
        /// </summary>
        [DataMember]
        public Guid ProcessSegmentId { get; set; }
        #endregion

        #region 工时定额 —— TimeSpan DurationQuota
        /// <summary>
        /// 工时定额
        /// </summary>
        [DataMember]
        public TimeSpan DurationQuota { get; set; }
        #endregion

        #region 工艺指导书 —— string DirectivePath
        /// <summary>
        /// 工艺指导书
        /// </summary>
        /// <remarks>PDF路径</remarks>
        [DataMember]
        public string DirectivePath { get; set; }
        #endregion

        #region 工厂模型Id —— Guid? FacilityId 
        /// <summary>
        /// 工厂模型Id
        /// </summary>
        [DataMember]
        public Guid? FacilityId { get; set; }
        #endregion

        #region 工位Id —— Guid? WorkStationId 
        /// <summary>
        /// 工位Id
        /// </summary>
        [DataMember]
        public Guid? WorkStationId { get; set; }
        #endregion

        #region 表单模式 —— FormMode FormMode
        /// <summary>
        /// 表单模式
        /// </summary>
        [DataMember]
        public FormMode FormMode { get; set; }
        #endregion

        #region 表单定义 —— FormDefinition FormDefinition
        /// <summary>
        /// 表单定义
        /// </summary>
        [DataMember]
        public FormDefinition FormDefinition { get; set; }
        #endregion

        #region 表单实例 —— string FormInstance
        /// <summary>
        /// 表单实例
        /// </summary>
        [DataMember]
        public string FormInstance { get; set; }
        #endregion

        #region 工单状态 —— WorkOrderStatus Status
        /// <summary>
        /// 工单状态
        /// </summary>
        [DataMember]
        public WorkOrderStatus Status { get; set; }
        #endregion

        #region 异常原因 —— string ExceptionReason
        /// <summary>
        /// 异常原因
        /// </summary>
        [DataMember]
        public string ExceptionReason { get; set; }
        #endregion

        #region 分派班组Id —— Guid? DispatchedTeamId
        /// <summary>
        /// 分派班组Id
        /// </summary>
        [DataMember]
        public Guid? DispatchedTeamId { get; set; }
        #endregion

        #region 分派人员Id —— Guid? DispatchedPersonId
        /// <summary>
        /// 分派人员Id
        /// </summary>
        [DataMember]
        public Guid? DispatchedPersonId { get; set; }
        #endregion

        #region 实际开始时间 —— DateTime? ActualStartTime
        /// <summary>
        /// 实际开始时间
        /// </summary>
        [DataMember]
        public DateTime? ActualStartTime { get; set; }
        #endregion

        #region 实际结束时间 —— DateTime? ActualEndTime
        /// <summary>
        /// 实际结束时间
        /// </summary>
        [DataMember]
        public DateTime? ActualEndTime { get; set; }
        #endregion

        #region 是否需质检 —— bool NeedToInspect
        /// <summary>
        /// 是否需质检
        /// </summary>
        [DataMember]
        public bool NeedToInspect { get; set; }
        #endregion

        #region 是否已质检 —— bool? HasInspected
        /// <summary>
        /// 是否已质检
        /// </summary>
        [DataMember]
        public bool? HasInspected { get; set; }
        #endregion

        #region 排序 —— int Sort
        /// <summary>
        /// 排序
        /// </summary>
        [DataMember]
        public int Sort { get; set; }
        #endregion

        #region 描述 —— string Description
        /// <summary>
        /// 描述
        /// </summary>
        [DataMember]
        public string Description { get; set; }
        #endregion


        //导航属性

        #region 导航属性 - 作业计划 —— ExecutionPlanInfo ExecutionPlanInfo
        /// <summary>
        /// 导航属性 - 作业计划
        /// </summary>
        [DataMember]
        public ExecutionPlanInfo ExecutionPlanInfo { get; set; }
        #endregion

        #region 导航属性 - 工厂模型 —— FacilityInfo FacilityInfo
        /// <summary>
        /// 导航属性 - 工厂模型
        /// </summary>
        [DataMember]
        public FacilityInfo FacilityInfo { get; set; }
        #endregion

        #region 导航属性 - 工位 —— WorkStationInfo WorkStationInfo
        /// <summary>
        /// 导航属性 - 工位
        /// </summary>
        [DataMember]
        public WorkStationInfo WorkStationInfo { get; set; }
        #endregion

        #region 导航属性 - 分派班组 —— TeamInfo DispatchedTeamInfo
        /// <summary>
        /// 导航属性 - 分派班组
        /// </summary>
        [DataMember]
        public TeamInfo DispatchedTeamInfo { get; set; }
        #endregion

        #region 导航属性 - 分派人员 —— PersonInfo DispatchedPersonInfo
        /// <summary>
        /// 导航属性 - 分派人员
        /// </summary>
        [DataMember]
        public PersonInfo DispatchedPersonInfo { get; set; }
        #endregion
    }
}
